#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>

//https://www.nowcoder.com/practice/a30bbc1a0aca4c27b86dd88868de4a4a?tpId=37&&tqId=21269&rp=1&ru=/ta/huawei&qru=/ta/huawei/question-ranking

int main() {
    char str[1001];
    int n = 0;
    scanf("%s", str);
    scanf("%d", &n);
    str[n] = '\0';
    printf("%s", str);
    return 0;
}